package com.autonavi.yunda.yunji.controller.response;

import com.alibaba.buc.sso.client.vo.BucSSOUser;
import com.autonavi.yunda.yunji.core.enums.RoleType;
import com.autonavi.yunda.yunji.service.model.FactoryUserDetail;
import com.autonavi.yunda.yunji.service.model.UserResourceVO;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author cizhong.wcs
 * @date 2023/6/5 10:56
 */
@Data
public class UserInfoResponse {
    private BucSSOUser bucUserData;
    private List<UserResourceVO> permissions = new ArrayList<>();
    private RoleType roleType;
    private String empId;
    private String nickNameCn;
    private FactoryUserDetail factoryUser;

    public void setBucUserData(BucSSOUser bucUserData) {
        this.bucUserData = bucUserData;
        if (bucUserData != null) {
            this.empId = bucUserData.getEmpId();
            this.nickNameCn = bucUserData.getNickNameCn();
        }
    }
}
